UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VHei/mD5mW9Q+mTyWdEq+Z/amiRtqgUhZv858CZObrM='
WHERE
key_id = '0667481f55f674d170b5bb753290acb9cc66cca08ddd5c604bfaaac3ae7d316c'
AND (
token = 'VHei/mD5mW9Q+mTyWdEq+Z/amiRtqgUhZv858CZObrM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)