UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HSfBPM6ljTyMN+2YmPdFSVOl6kfwJfIa7541cv2WDJI='
WHERE
key_id = '3db2c2af8d6b801b2cb3a1026594789928ee70684f30e61dec7e1086e62a95e6'
AND (
token = 'HSfBPM6ljTyMN+2YmPdFSVOl6kfwJfIa7541cv2WDJI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)