UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oY7875uv4yQPz7R9Qr+zlUeGdVsoGfQvYkCZcupI7h8='
WHERE
key_id = '96780832eaf29dd2d641454594737460e3d55aaf60a087064d316cf9fde3bce5'
AND (
token = 'oY7875uv4yQPz7R9Qr+zlUeGdVsoGfQvYkCZcupI7h8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)