UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HXEtoZsHgWQ6WRzWLlzDHQBp/nHMSU9l5LIo5gAAl5o='
WHERE
key_id = '77834a5419af9289b588a8bf321afbc9a66fc03cae5b9634e63f01961d9edd37'
AND (
token = 'HXEtoZsHgWQ6WRzWLlzDHQBp/nHMSU9l5LIo5gAAl5o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)