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