UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '80r9UrRn+bjUAU2+ZxJxXt0VaBoxSPedeg4zYOmBL6I='
WHERE
key_id = 'a98d10f5b0ef2330e4ec697d645755ab43cb19a2a867259a832d3c5394ecf63e'
AND (
token = '80r9UrRn+bjUAU2+ZxJxXt0VaBoxSPedeg4zYOmBL6I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)