UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Hfwh8ovh48WS1RlEhTlYN1FTzEnNrsxT7mDR8WzIBRM='
WHERE
key_id = '2cf6bffc456162ba3694ef98fc88347589d539697e8bfd0893113dcb9ef5f4f5'
AND (
token = 'Hfwh8ovh48WS1RlEhTlYN1FTzEnNrsxT7mDR8WzIBRM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)