UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MtI3Snb2pevzAYmUvWULbsGPvF4MLMjM3+RntoStTm0='
WHERE
key_id = 'e02c64b435ebb1c86f49a83e112a5850dd073627be2a2cdc6070217103e24887'
AND (
token = 'MtI3Snb2pevzAYmUvWULbsGPvF4MLMjM3+RntoStTm0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)