UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FeaGToMOYKKasKYtHMN5Idheanm40WbwtIPP9MtNYPQ='
WHERE
key_id = '2c3da7be6a4695fe853c157f2cdf276828f485bb380cdad83c6b351161d1315d'
AND (
token = 'FeaGToMOYKKasKYtHMN5Idheanm40WbwtIPP9MtNYPQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)