UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ko/lEIYSenxWEowcM5Bbk3WxUsrocgmoC7WWO0mNT3s='
WHERE
key_id = '2997221ce4e0379c761fac19ea820cc6bcc5718920a21d892b767cfed4255f5a'
AND (
token = 'Ko/lEIYSenxWEowcM5Bbk3WxUsrocgmoC7WWO0mNT3s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)