UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9nTQ6LSCSG3Pp29UVGCMn6RJAvK/nCltxo9F3skJs1I='
WHERE
key_id = 'fc62e708f0e66f5626c9b2a45dfa00dbe2527167e7337f8997ae157173262e47'
AND (
token = '9nTQ6LSCSG3Pp29UVGCMn6RJAvK/nCltxo9F3skJs1I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)