UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r5mNz5De2WvdWnSbJawxSNwn4nTTWxWyhCEexBBugIQ='
WHERE
key_id = 'baecf208d5462289848f30206f55c8303eb6c71409112495c59977c2395250c4'
AND (
token = 'r5mNz5De2WvdWnSbJawxSNwn4nTTWxWyhCEexBBugIQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)