UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rHUrJ5AAjjDWiLnoLHqQy6AaOMnYUC4eMNCgtuhtxDY='
WHERE
key_id = '998bd7c9fb9b83569f98c6c80b5ded8dc3980275d123d6b1a525d945ccc21126'
AND (
token = 'rHUrJ5AAjjDWiLnoLHqQy6AaOMnYUC4eMNCgtuhtxDY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)