UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd9t+ktKNwt4Q2sXhu4unLkMgdMA4fhSMlVw/SSUf6Ic='
WHERE
key_id = '1abc3c91a9ca63cdd8a4c8320008c2134bdad59632bcea43f040456b226580cf'
AND (
token = 'd9t+ktKNwt4Q2sXhu4unLkMgdMA4fhSMlVw/SSUf6Ic='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)