UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ai/3NQ7Eu5DsR8opabL/cUndfVuBwZVYf7h/Qjefbcc='
WHERE
key_id = '7d00b89f0b75a4492d66ae49cc5f358e06f878a8b0085d36cf5524358d78e82c'
AND (
token = 'ai/3NQ7Eu5DsR8opabL/cUndfVuBwZVYf7h/Qjefbcc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)