UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WfoS7aJ9KNZCXep9WoZWM+IZC2991faR2QYHguU7gs4='
WHERE
key_id = '54a2c69c1119c6bceeb6eec0f63fe8b299a2da3b106c4fb6884039859d9dbcb6'
AND (
token = 'WfoS7aJ9KNZCXep9WoZWM+IZC2991faR2QYHguU7gs4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)