UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rVUfeOva4tUXsDj1BOE61rT5aFsklWvcUR6qXOM0kb8='
WHERE
key_id = 'd425c9f8ba815f7e0238779f1a21a071c97308d459f41c263f5c29c109aa4808'
AND (
token = 'rVUfeOva4tUXsDj1BOE61rT5aFsklWvcUR6qXOM0kb8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)