UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PbdVPd+0D+UtNrjhua/QoSH760UU3j0My/H9RLaJ5lA='
WHERE
key_id = '264fd07d68e82f373ae5dce81792bf20b44655dbf0a19a0411e24960e9a490fc'
AND (
token = 'PbdVPd+0D+UtNrjhua/QoSH760UU3j0My/H9RLaJ5lA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)