UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7MLwV63Z3fgHJ0uMDirbn11aiQdmCmWHHLsggv1qHRg='
WHERE
key_id = '59ea8320a489f4efbe06e36a8f2aeadcdd91b5467258b44b07f676d77fd8805c'
AND (
token = '7MLwV63Z3fgHJ0uMDirbn11aiQdmCmWHHLsggv1qHRg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)