UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IiXcUnjJ/AJFKWLypOiX940OoztmerK8Ylpw1rpWjH0='
WHERE
key_id = '529477f2a0c24dc389168bec6fcd97e6c5a284b7b797ec534b57437fd9460fce'
AND (
token = 'IiXcUnjJ/AJFKWLypOiX940OoztmerK8Ylpw1rpWjH0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)