UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oZdKRpslExjAZd3BWDVnbdu7ILOZzpWSAfIonB8ktZY='
WHERE
key_id = '936b2308e816397573dd867bf682eba81cf3abb866ea1689d0a6d1120e4e7471'
AND (
token = 'oZdKRpslExjAZd3BWDVnbdu7ILOZzpWSAfIonB8ktZY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)