UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gwbtsgbqDCWmRIFkJ+w4U0aBguf9dThPZeRTz0DMTiY='
WHERE
key_id = '0fcb9fa00b4ce363ac27cdd9ffc431db158e14fdb0e223a1319cf582630213ee'
AND (
token = 'gwbtsgbqDCWmRIFkJ+w4U0aBguf9dThPZeRTz0DMTiY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)