UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BoXAJDKIsx4nnZb26dHbjOla/MBYpnu3+fZDgveICas=' 
WHERE 
  key_id = 'bbbc592e64b7c2a15235dfb1707a8ee326e8881b33fb0a179c4e4bae8be3110c' 
  AND (
    token = 'BoXAJDKIsx4nnZb26dHbjOla/MBYpnu3+fZDgveICas=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050