UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IlPqbzljV4Md+EBXHM0jPRADZs33zd0+IVV+lsMwANY='
WHERE
key_id = 'cf94da119dad9c998b86c3c8d2698f35ee91975546c98ca9780b2fa48ad3e47d'
AND (
token = 'IlPqbzljV4Md+EBXHM0jPRADZs33zd0+IVV+lsMwANY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)