UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uBO2W0XmDuDLsoi2B1tb7a+O+n0rxKqBHh8UxF3jz8k='
WHERE
key_id = '38162999bcd3f7712835b44122788c58a6d619bf538e5b1fb8caddf2065fe028'
AND (
token = 'uBO2W0XmDuDLsoi2B1tb7a+O+n0rxKqBHh8UxF3jz8k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)