UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '10K74RFVRXtiP1oeVVBI2JceQBRY/wMWSaZjDuOhHpk='
WHERE
key_id = 'aaacbffdea3baf0f1f8046dc210e2955b27ae3266ba6f459523c6f03653d68ba'
AND (
token = '10K74RFVRXtiP1oeVVBI2JceQBRY/wMWSaZjDuOhHpk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)