UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PbmhUgYgXvEbFEJXwJQTuHRBuntx9lBfmGn/BBTYmCc='
WHERE
key_id = 'd636763b46d49177aaa4a92dc46c2252bdfbc02b44096a677361f393079dd9dc'
AND (
token = 'PbmhUgYgXvEbFEJXwJQTuHRBuntx9lBfmGn/BBTYmCc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)