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